import React from 'react';
import {Text, TouchableOpacity, View} from 'react-native';
import Styles from './Styles';

export default class Detail2 extends BaseComponent {
    //接收上一个页面传过来的title显示出来
    static navigationOptions = ({navigation}) => ({
        title: navigation.state.params.title
    });
    // 点击返回上一页方法
    backVC = () => {
        //返回首页方法
        this.props.navigation.goBack();
    };

    render() {
        const {navigate} = this.props.navigation;
        return (
            <View style={Styles.container}>
                <TouchableOpacity
                    style={Styles.touchStyle}
                    onPress={() => {
                        //this.backVC()
                        this.props.navigation.navigate('Detail1', {title: 'Detail1', des: '信息'})
                    }}
                >
                    <Text>{this.props.navigation.state.params.des}</Text>
                </TouchableOpacity>
            </View>
        );
    }
}
